package com.kintreda.ieco_server.module.order.service.impl;

import com.kintreda.ieco_server.bean.goods.Items;
import com.kintreda.ieco_server.core.service.impl.BaseServiceImpl;
import com.kintreda.ieco_server.module.order.service.IRegenerantService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Created by IntelliJ IDEA
 * @Project_Name ieco_server
 * @Package com.kintreda.ieco_server.module.order.service.impl
 * @Author ZhongYao_H
 * @Date 2019/5/3:20:09
 * @Year 2019 Month 05 Day 03
 * @Date_zh 2019 年 五月 星期五
 */
@Service
public class RegenerantServiceImpl extends BaseServiceImpl<Items,String> implements IRegenerantService {
    @Override
    public Boolean isadd(String name) {
        List<Items> query = query("from Items where name = ? ", new Object[]{name});
        return query.size()>0;

    }

    @Override
    public List<Items> getType(String type) {
        return query("from Items where typeA = ?",new Object[]{type});

    }

    @Override
    public List<Items> getByTypeId(String typeId) {
        return query("from Items where type = ?",new Object[]{typeId});
    }
}
